
def sum(num_list):
    if len(num_list) == 0:
        return 0
    elif len(num_list) == 1:
        return num_list[0]
    else:
        return num_list[0] + sum(num_list[1:])

def quick_sort(num_list):
    if len(num_list) < 2:
        return num_list
    index = len(num_list)//2
    pivot = num_list[index]
    less = [i for i in num_list[:index]+num_list[index+1:] if i <= pivot]
    greater = [i for i in num_list[:index]+num_list[index+1:] if i > pivot]
    return quick_sort(less) + [pivot] + quick_sort(greater)



import random
if __name__ == '__main__':
    print(sum([2,3,4,5]))
    num_array = [random.randint(1,100) for _ in range(11)]
    print('Orignal num list is ', num_array)
    sorted_num_list = quick_sort(num_array)
    print('Sorted num list is ',sorted_num_list)